<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      img {
        width: 600px;
      }
    </style>
  </head>
  <body>
    <img src="./images/1.png" alt="我是播仔" />
  </body>
</html>
<script>
  // 1.先获取元素
  const img = document.querySelector("img");
  // 2.操作DOM元素属性
  // 2.1  查
  // console.log(img.src);
  // console.log(img.alt);

  // 2.2  改
  img.src = "./images/2.png";

  // 2.3  增
  img.title = "你好哇哇哇！";

  // 2.4  删
  img.src = "";
</script>
